// 宇右船舶工序能源数据采集

import * as flow from "./flow";

// 工序一级Table
export const workColumns = {
  0: [
    ...flow.commonColumns,
    {
      title: "切割文件号",
      dataIndex: "no",
      key: "no",
    },
    {
      title: "切割长度",
      dataIndex: "length",
      key: "length",
    },
    {
      title: "钢板类型",
      dataIndex: "type",
      key: "type",
    },
    {
      title: "厚度",
      dataIndex: "weight",
      key: "weight",
    },
    {
      title: "设备类型",
      dataIndex: "deviceType",
      key: "deviceType",
    },
    {
      title: "设备型号",
      dataIndex: "deviceNo",
      key: "deviceNo",
    },
    {
      title: "电表起始读数",
      dataIndex: "startPower",
      key: "startPower",
    },
    {
      title: "电表结束读数",
      dataIndex: "endPower",
      key: "endPower",
    },
    {
      title: "用电量",
      dataIndex: "powers", // 动态计算 endPower-startPower
      key: "powers",
      customRender: ({ text }) => {
        return text ? text.toFixed(3) : 0;
      },
    },
    {
      title: "氧气起始读数",
      dataIndex: "startO2",
      key: "startO2",
    },
    {
      title: "氧气结束读数",
      dataIndex: "endO2",
      key: "endO2",
    },
    {
      title: "耗氧气量(m³)",
      dataIndex: "o2", // 动态计算 endO2-startO2
      key: "o2",
      customRender: ({ text }) => {
        return text ? text.toFixed(3) : 0;
      },
    },
    {
      title: "压缩空气开始读数",
      dataIndex: "startAir",
      key: "startAir",
    },
    {
      title: "压缩空气结束读数",
      dataIndex: "endAir",
      key: "endAir",
    },
    {
      title: "耗压缩空气量(m³)",
      dataIndex: "air", // 动态计算 endAir-startAir
      key: "air",
      customRender: ({ text }) => {
        return text ? text.toFixed(3) : 0;
      },
    },
  ],
  1: flow.workColumns["1"],
  2: flow.workColumns["2"],
  3: flow.workColumns["3"],
  4: flow.workColumns["4"],
  "5-0": flow.workColumns["5-0"],
  "5-1": flow.workColumns["5-1"],
  "6-0": [
    ...flow.commonColumns,
    { title: "施工位置", dataIndex: "place", key: "place" },
    { title: "开始日期", dataIndex: "startTime", key: "startTime" },
    { title: "结束日期", dataIndex: "endTime", key: "endTime" },
    { title: "施工面积(m²)", dataIndex: "area", key: "area" },
    { title: "压缩空气开始读数", dataIndex: "startAir", key: "startAir" },
    { title: "压缩空气结束读数", dataIndex: "endAir", key: "endAir" },
    {
      title: "压缩空气量",
      dataIndex: "air",
      key: "air",
      customRender: ({ text }) => {
        return text ? text.toFixed(3) : 0;
      },
    }, //动态计算 endAir-startAir
  ],
  "6-1": flow.workColumns["6-1"],
  "7-1": flow.workColumns["7-1"],
  8: flow.workColumns["8"],
  9: flow.workColumns["9"],
};

// 工序二级Table
export const innerColumns = {
  "6-1": flow.innerColumns["6-1"],
  "7-1": flow.innerColumns["7-1"],
  8: flow.innerColumns["8"],
};
